package com.vive.mail;

import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.panel.Panel;

import java.text.MessageFormat;

public class MailInfoPane extends Panel {

    private Label receivedMailLabel;
    private Label deletedMailLabel;
    private Label innerMailLabel;
    public MailInfoPane(String id) {
        super(id);

        receivedMailLabel = new Label("receivedMailLabel", "");
        deletedMailLabel = new Label("deletedMailLabel", "");
        innerMailLabel = new Label("innerMailLabel", "");

        this.add(receivedMailLabel);
        this.add(deletedMailLabel);
        this.add(innerMailLabel);
    }

    protected void onAttach(){
        int receivedMailCount = 19;
        int deletedMailCount = 3;
        int innerMailCount = 5;

        receivedMailLabel.setDefaultModelObject(MessageFormat.format("收到邮件{0}件",
                new Object[]{new Integer(receivedMailCount)}));
        deletedMailLabel.setDefaultModelObject(MessageFormat.format("删除邮件{0}件",
                new Object[]{new Integer(deletedMailCount)}));
        innerMailLabel.setDefaultModelObject(MessageFormat.format("内部邮件{0}件",
                new Object[]{new Integer(innerMailCount)}));
    }

}
